package mediator;

import lombok.Data;

/**
 * 具体中介类
 */

@Data
public class ConcreteMediator extends Mediator {

    private ConcreteColleague1 colleague1;

    private ConcreteColleague2 colleague2;

    @Override
    public void send(String message, Colleague colleague) {
        if (colleague == colleague1) {
            colleague2.nootify(message);
        } else{
            colleague1.nootify(message);
        }
    }
}
